package cn.itcast.n3_Java线程;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @program: juc
 * @description:
 * @author: flyduck
 * @create: 2024-08-28 16:08
 **/
@Slf4j(topic = "c.Test10_sleep方法_使用TimeUnit代替sleep")
public class Test10_sleep方法_使用TimeUnit代替sleep {

    public static void main(String[] args) throws InterruptedException {
//        Thread.sleep(1000);
        log.debug("sleep start...");
        TimeUnit.SECONDS.sleep(1);//效果一样，这个一看就是1秒
        log.debug("sleep end...");
    }
}
